<?php
/**
 * Active record of Dending status one email for one subscriber
 *
 * @author Lukas Normantas
 */
class Newsletter_Model_Sendstatus extends Doctrine_Record
{

    public function setTableDefinition()
    {
        $this->setTableName('newsletter_subscribers');
        $this->hasColumn('subscriber_id', 'int');
        $this->hasColumn('letter_id', 'int');
        $this->hasColumn('success', 'boolean', 25);
    }

    public function setUp()
    {
        $this->actAs('Timestampable');

        $this->hasOne('Newsletter_Model_Subscriber as Subscriber', array(
            'local' => 'subscriber_id',
            'foreign' => 'id'
        ));

        $this->hasOne('Newsletter_Model_Letter as Letter', array(
            'local' => 'letter_id',
            'foreign' => 'id'
        ));
    }    
}
